/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedBean;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.inject.Named;
import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.SessionScoped;
import org.primefaces.event.DateSelectEvent;
import org.primefaces.event.ScheduleEntrySelectEvent;
import org.primefaces.model.DefaultScheduleEvent;
import org.primefaces.model.DefaultScheduleModel;
import org.primefaces.model.ScheduleEvent;
import org.primefaces.model.ScheduleModel;

/**
 *
 * @author Mic
 */
@Named(value = "scheduleBean")
@RequestScoped
public class ScheduleBean {
private ScheduleModel model;
private ScheduleEvent event;
public ScheduleBean() {
    event = new DefaultScheduleEvent();
    model = new DefaultScheduleModel();
    Date debut = new Date(System.currentTimeMillis());
   
    GregorianCalendar calendar = new java.util.GregorianCalendar(); 
// Initialisé à la date et l'heure courrante. 
    calendar.setTime( new Date()); 
// Initialisé avec une instance de Date. 
    calendar.add (Calendar.DATE, +2);
    
    model.addEvent(new DefaultScheduleEvent("test", debut,calendar.getTime()));
    model.addEvent(new DefaultScheduleEvent("title", new Date(),new Date()));
}
public ScheduleModel getModel() { return model; }
}